<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
	http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
	http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
	http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd">

	<mvc:annotation-driven>
		<mvc:message-converters>
			<bean class="org.jeneva.spring.JenevaJsonConverter" />
		</mvc:message-converters>
	</mvc:annotation-driven>
	<mvc:resources mapping="/resources/**" location="/resources/" />

	<context:component-scan base-package="org.myclients.controllers" />
	<context:component-scan base-package="org.myclients.validation" />
	<context:component-scan base-package="org.myclients.services.impl" />
	<context:component-scan base-package="org.myclients.dao.impl" />
	<context:annotation-config />

	<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
		<property name="defaultLocale" value="en_US" />
	</bean>

	<bean class="org.springframework.web.servlet.view.UrlBasedViewResolver" id="viewResolver">
		<property name="prefix" value="/WEB-INF/views/"/>
		<property name="suffix" value=".jsp"/>
		<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
	</bean>

	<bean id="upidaDB" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
		<property name="driverClassName" value="org.sqlite.JDBC" />
		<property name="url" value="jdbc:sqlite:D:\CODEPLEX\JENEVA\Examples\MyClients\WebContent\jeneva.sqlite" />
		<property name="username" value="" />
		<property name="password" value="" />
	</bean>

	<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
		<property name="dataSource" ref="upidaDB" />
		<property name="packagesToScan" value="org.upida.example.domain" />
		<property name="configLocation" value="/WEB-INF/hibernate.cfg.xml" />
	</bean>

	<bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
		<property name="sessionFactory" ref="sessionFactory"></property>
	</bean>
	<tx:annotation-driven />

	<bean id="jenevaContext" class="org.jeneva.impl.JenevaContext" scope="singleton" factory-method="current" />
	<bean id="mapper" class="org.jeneva.impl.Mapper" scope="singleton">
		<constructor-arg ref="jenevaContext"></constructor-arg>
	</bean>
	<bean id="parser" class="org.jeneva.impl.JsonParser" scope="singleton">
		<constructor-arg ref="jenevaContext"></constructor-arg>
	</bean>
</beans>